﻿#include "DAAppUI.h"
#include "DAAppDockingArea.h"
#include "DAAppRibbonArea.h"
#include "DAAppCommand.h"
//===================================================
// using DA namespace -- 禁止在头文件using！！
//===================================================

using namespace DA;

//===================================================
// DAAppUI
//===================================================
DAAppUI::DAAppUI(SARibbonMainWindow* m, DACoreInterface* c) : DAAppUIInterface(m, c)
{
    createCmd();  // cmd必须先创建，因为
    createDockingArea();
    createRibbonArea();
    //设置dockarea给RibbonArea
    m_ribbonArea->buildRedoUndo(m_cmd);
    m_ribbonArea->setDockAreaInterface(m_dockingArea);
}

DAAppDockingAreaInterface* DAAppUI::dockingArea()
{
    return m_dockingArea;
}

DAAppRibbonAreaInterface* DAAppUI::ribbonArea()
{
    return m_ribbonArea;
}

DAAppCommand* DAAppUI::getAppCmd()
{
    return m_cmd;
}

void DAAppUI::createCmd()
{
    m_cmd = new DAAppCommand(this);
    registeCommand(m_cmd);
}

void DAAppUI::createDockingArea()
{
    m_dockingArea = new DAAppDockingArea(this);
    registeExtend(m_dockingArea);
}

void DAAppUI::createRibbonArea()
{
    m_ribbonArea = new DAAppRibbonArea(this);
    registeExtend(m_ribbonArea);
}
